import pygame
from pygame.locals import *
from sys import exit
from PictureClass import *
from Picture import *
from MusicClass import *
 
SCREEN_SIZE = (800, 600)

pygame.mixer.pre_init(44100, -16, 2, 1024*4)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32)
stop = Picture("Pictures/stop.jpg", (155, 10))
previous = Picture("Pictures/previous.jpg", (50, 50))
play = Picture("Pictures/play.jpg", (150, 50))
pause = Picture("Pictures/pause.jpg", (150, 50))
next = Picture("Pictures/next.jpg", (250, 50))
pictureClass = PictureClass()
fullScreen = False
musicClass = MusicClass()
music = "Musics/example.mp3"

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()
    if event.type == MOUSEBUTTONDOWN or event.type == MOUSEBUTTONUP:
        x, y = pygame.mouse.get_pos()
        if play.getRect().collidepoint(x, y):
            pygame.mixer.music.load(music)
            pygame.mixer.music.play()
                             
    fullScreen = pictureClass.fullScreen(SCREEN_SIZE, event, fullScreen)
    screen.blit(stop.getImage(), stop.getTopLeft())
    screen.blit(play.getImage(), play.getTopLeft())
    screen.blit(next.getImage(), next.getTopLeft())
    screen.blit(previous.getImage(), previous.getTopLeft())
    pygame.display.update()    
    
    
    